package com.shigu.mo.bo;

import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.methods.multipart.StringPart;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class SettlementCallbackBO extends YeepayCallbackBO{

    protected List<Part> parts = new ArrayList<Part>();

    private String mainCustomerNumber;
    private String customerNumber;
    private String externalNo;
    private String serialNo;
    private String transferStatus;
    private String requestTime;
    private String handleTime;
    private String transferWay;
    private String receiver;
    private String receiverBankCardNo;
    private String receiverBank;
    private String amount;
    private String fee;
    private String basicFee;
    private String exTargetFee;
    private String actualAmount;
    private String failReason;
    private String hmac;
//    private String mainCustomerNumber="10015808909";
//    private String customerNumber="10015883470";
//    private String externalNo="settlement_6";
//    private String serialNo="SKBRJT87c0d871a5c24c41b56ecbd696f53b08";
//    private String transferStatus="SUCCESSED";
//    private String requestTime="2017-12-11 20:20:11";
//    private String handleTime="2017-12-11 20:20:13";
//    private String transferWay="1";
//    private String receiver="赵*波";
//    private String receiverBankCardNo="621226*********9254";
//    private String receiverBank="工商银行";
//    private String amount="9.96";
//    private String fee="0";
//    private String basicFee="2.0";
//    private String exTargetFee="0.0";
//    private String actualAmount="7.96";
//    private String failReason="";
//    private String hmac="a14f66918fdba3acd466885c865da480";

    private ArrayList<String> needHmac=new ArrayList<>(Arrays.asList(
            "mainCustomerNumber",
            "customerNumber",
            "externalNo",
            "serialNo",
            "transferStatus",
            "requestTime",
            "handleTime",
            "transferWay",
            "receiver",
            "receiverBankCardNo",
            "receiverBank",
            "amount",
            "fee",
            "basicFee",
            "exTargetFee",
            "actualAmount",
            "failReason"
    ));

    public String getMainCustomerNumber() {
        return mainCustomerNumber;
    }

    public void setMainCustomerNumber(String mainCustomerNumber) {
        this.parts.add(new StringPart("mainCustomerNumber", mainCustomerNumber == null ? "" : mainCustomerNumber,
                "UTF-8"));
        this.mainCustomerNumber = mainCustomerNumber;
    }

    public String getCustomerNumber() {
        return customerNumber;
    }

    public void setCustomerNumber(String customerNumber) {
        this.parts.add(new StringPart("customerNumber", customerNumber == null ? "" : customerNumber,
                "UTF-8"));
        this.customerNumber = customerNumber;
    }

    public String getExternalNo() {
        return externalNo;
    }

    public void setExternalNo(String externalNo) {
        this.parts.add(new StringPart("externalNo", externalNo == null ? "" : externalNo,
                "UTF-8"));
        this.externalNo = externalNo;
    }

    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.parts.add(new StringPart("serialNo", serialNo == null ? "" : serialNo,
                "UTF-8"));
        this.serialNo = serialNo;
    }

    public String getTransferStatus() {
        return transferStatus;
    }

    public void setTransferStatus(String transferStatus) {
        this.parts.add(new StringPart("transferStatus", transferStatus == null ? "" : transferStatus,
                "UTF-8"));
        this.transferStatus = transferStatus;
    }

    public String getRequestTime() {
        return requestTime;
    }

    public void setRequestTime(String requestTime) {
        this.parts.add(new StringPart("requestTime", requestTime == null ? "" : requestTime,
                "UTF-8"));
        this.requestTime = requestTime;
    }

    public String getHandleTime() {
        return handleTime;
    }

    public void setHandleTime(String handleTime) {
        this.parts.add(new StringPart("handleTime", handleTime == null ? "" : handleTime,
                "UTF-8"));
        this.handleTime = handleTime;
    }

    public String getTransferWay() {
        return transferWay;
    }

    public void setTransferWay(String transferWay) {
        this.parts.add(new StringPart("transferWay", transferWay == null ? "" : transferWay,
                "UTF-8"));
        this.transferWay = transferWay;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.parts.add(new StringPart("receiver", receiver == null ? "" : receiver,
                "UTF-8"));
        this.receiver = receiver;
    }

    public String getReceiverBankCardNo() {
        return receiverBankCardNo;
    }

    public void setReceiverBankCardNo(String receiverBankCardNo) {
        this.parts.add(new StringPart("receiverBankCardNo", receiverBankCardNo == null ? "" : receiverBankCardNo,
                "UTF-8"));
        this.receiverBankCardNo = receiverBankCardNo;
    }

    public String getReceiverBank() {
        return receiverBank;
    }

    public void setReceiverBank(String receiverBank) {
        this.parts.add(new StringPart("receiverBank", receiverBank == null ? "" : receiverBank,
                "UTF-8"));
        this.receiverBank = receiverBank;
    }

    public String getAmount() {
        return amount;
    }

    public void setAmount(String amount) {
        this.parts.add(new StringPart("amount", amount == null ? "" : amount,
                "UTF-8"));
        this.amount = amount;
    }

    public String getFee() {
        return fee;
    }

    public void setFee(String fee) {
        this.parts.add(new StringPart("fee", fee == null ? "" : fee,
                "UTF-8"));
        this.fee = fee;
    }

    public String getBasicFee() {
        return basicFee;
    }

    public void setBasicFee(String basicFee) {
        this.parts.add(new StringPart("basicFee", basicFee == null ? "" : basicFee,
                "UTF-8"));
        this.basicFee = basicFee;
    }

    public String getExTargetFee() {
        return exTargetFee;
    }

    public void setExTargetFee(String exTargetFee) {
        this.parts.add(new StringPart("exTargetFee", exTargetFee == null ? "" : exTargetFee,
                "UTF-8"));
        this.exTargetFee = exTargetFee;
    }

    public String getActualAmount() {
        return actualAmount;
    }

    public void setActualAmount(String actualAmount) {
        this.parts.add(new StringPart("actualAmount", actualAmount == null ? "" : actualAmount,
                "UTF-8"));
        this.actualAmount = actualAmount;
    }

    public String getFailReason() {
        return failReason;
    }

    public void setFailReason(String failReason) {
        this.parts.add(new StringPart("failReason", failReason == null ? "" : failReason,
                "UTF-8"));
        this.failReason = failReason;
    }

    public void setHmac(String hmac) {
        this.hmac = hmac;
    }

    @Override
    public Part[] generateParams() {
        return parts.toArray(new Part[parts.size()]);
    }

    @Override
    public String getHmac() {
        return this.hmac;
    }

    @Override
    public List<String> needHmacArr() {
        return needHmac;
    }
}
